import axiosMethods from '@/utils/request'
import { LOGIN_PREFIX } from '@/api/apiConst'

// 关注程度下拉列表
export function pollutantDegreeList(params) {
  return axiosMethods.get(LOGIN_PREFIX + '/pollutant/degreeList', params)
}

// 功能区类型
export function pollutantFunctionTypeList(params) {
  return axiosMethods.get(LOGIN_PREFIX + '/pollutant/functionTypeList', params)
}

// 行业类型下拉列表
export function pollutantIndustryList(params) {
  return axiosMethods.get(LOGIN_PREFIX + '/pollutant/industryList', params)
}

// 行政区划下拉列表
export function pollutantRegionList(params) {
  return axiosMethods.get(LOGIN_PREFIX + '/pollutant/regionList', params)
}

// 站点类型下拉列表
export function pollutantSiteTypeList(params) {
  return axiosMethods.get(LOGIN_PREFIX + '/pollutant/siteTypeList', params)
}

// 标准级别下拉列表
export function pollutantStandLevelList(params) {
  return axiosMethods.get(LOGIN_PREFIX + '/pollutant/standLevelList', params)
}

// 流域下拉列表
export function pollutantValleyList(params) {
  return axiosMethods.get(LOGIN_PREFIX + '/pollutant/valleyList', params)
}

// 保存或更新监测设备数据
export function equipmentSaveOrUpdate(params) {
  return axiosMethods.post(LOGIN_PREFIX + '/equipment/saveOrUpdate', JSON.stringify(params), {
    transformRequest: [
      function(data) {
        return data
      }
    ],
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

// 分页获取监控点下的设备
export function equipmentEquipPageList(params) {
  return axiosMethods.get(LOGIN_PREFIX + '/equipment/equipPageList', params)
}
// 删除设备
export function equipmentDelete(params) {
  return axiosMethods.delete(LOGIN_PREFIX + '/equipment/delete', params)
}
// 保存或更新监测关联因子数据
export function factorSaveOrUpdate(params) {
  return axiosMethods.post(LOGIN_PREFIX + '/factor/saveOrUpdate', JSON.stringify(params), {
    transformRequest: [
      function(data) {
        return data
      }
    ],
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

// 获取监测设备下的监测因子
export function factorFindMonitorFactor(params) {
  return axiosMethods.get(LOGIN_PREFIX + '/factor/findMonitorFactor', params)
}

// 删除关联因子
export function factorDelete(params) {
  return axiosMethods.get(LOGIN_PREFIX + '/factor/delete', params)
}
// 获取监测类型下的监测因子(排除监测点已关联的因子)
export function pollutantFindList(params) {
  return axiosMethods.get(LOGIN_PREFIX + '/pollutant/findList', params)
}

// 删除监测因子
export function pollutantDelete(params) {
  return axiosMethods.delete(LOGIN_PREFIX + '/pollutant/delete', params)
}

// 根据附件id删除附件
export function fileDelAttacheId(attacheId) {
  return axiosMethods.get(LOGIN_PREFIX + `/file/del/${attacheId}`, {})
}

// 断面分类列表
export function pollutantSectionTypeList(attacheId) {
  return axiosMethods.get(LOGIN_PREFIX + '/pollutant/sectionTypeList', {})
}
